import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(ElementUI);

import axios from 'axios'

axios.interceptors.request.use(
  config => {
    //把jwt拼到请求头中
    let jwt = localStorage.getItem("authorization")
    if (jwt) {
      config.headers.authorization = jwt
    }
    return config;
  }
)

Vue.prototype.$axios = axios

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
